<template>
	<view class="register">
		<van-dialog id="van-dialog" />
		<!-- 	<button @click="login">Login</button>
		<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">getPhoneNumber</button> -->
		<image style="width: 200rpx;height: 200rpx;margin: 120rpx 0;" src="../../static/logo.png"></image>
		<view class="getPhoneNum">
			<view class="phone">
				<span>{{}}</span>****<span>{{}}</span>
				<span style="color: #007AFF;">切换手机号</span>
			</view>
			<view class="login" @click="login">一键登录</view>
		</view>
		<view class="way">
			<view class="left"></view>
			<view class="content">其他登录方式</view>
			<view class="right"></view>
		</view>
		<view class="imag">
			<image @click="goPhone" src="../../static/手机.png"></image>
			<image src="../../static/微信.png"></image>
			<image src="../../static/qq.png"></image>
		</view>
		<view class="attestation">
			<view class="text">天翼账号提供认证服务</view>
			<view class="text">
				<checkbox :checked="check" @click="checkBox" />
				同意<span style="color: #07C160;">《天翼账号服务与协议》</span>和<span style="color: #07C160;">隐私政策</span>并授权鱼泡网获得本机号码</view>
		</view>
	</view>
</template>

<script>
	import {
		userRegister
	} from '../../api/login.js'
	import Dialog from '../../wxcomponents/vant-weapp/dialog/dialog'
	export default {
		data() {
			return {
				userName: "",
				obj: {
					"name": "测试",
					"temple": 0,
					"phone": "13445678911",
					"password": "123456",
					"verificationCode": "1111",
					"parentId": "131"
				},
				check: true
			}
		},
		methods: {
			enroll() {
				debugger
				console.info(this.obj)
				userRegister(this.obj).then(res => {
					console.info(res)
				})
			},
			login(e) {
				if(this.check){
					
				}else{
					Dialog({
						message: "请勾选协议",
					})
				}
			},
			getPhoneNumber(e) {
				console.log(e.detail.errMsg);
				console.log(e.detail.iv);
				console.log(e.detail.encryptedData);
			},
			checkBox() {
				this.check = this.check ? false : true
			},
			goPhone(){
				uni.navigateTo({
					url:'login?cur='+1
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.register {
		display: flex;
		flex-direction: column;
		align-items: center;
		.getPhoneNum{
			margin: 80rpx;
			text-align: center;
			.login{
				margin-top: 30rpx;
				background: #007AFF;
				padding: 10rpx 120rpx;
				color: #FFFFFF;
				border-radius: 10rpx;
			}
		}
		.way{
			color: #838383;
			display: flex;
			align-items: center;
			font-size: 30rpx;
			.left,.right{
				border-bottom: solid 1px #c3c3c3;
				width: 34vw;
			}
			.content{
				margin: 0 10rpx;
			}
		}
		.imag{
			display: flex;
			margin-top: 40rpx;
			margin-bottom: 80rpx;
			image{
				width: 80rpx;
				height: 80rpx;
				margin: 0 20rpx;
			}
		}
		.attestation{
			font-size: 24rpx;
			text-align: center;
			width: 90vw;
			color: #5e5e5e;
		}
	}
</style>
